<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

  <script>
    // Object 类型的基本使用
    var name = 'why'
    var age = 18
    var height = 1.88

    var person = {
      name: 'why',
      age: 18,
      height: 1.88
    }
    console.log(person)

    // 对象类型中的某一个属性
    console.log(person.name)

    var message = "Hello World"
    console.log(message.length)

    // Null类型
    var age = 0
    var num = 0
    var message = ""
    var isAdmin = false

    // age/message/isAdmin -> false
    if (age) {
      console.log("分支语句不会执行")
    }


    // 当对一个对象类型进行初始化时,不建议初始化为{},建议初始化为null 
    var book = {} // true
    if (book) {
      console.log("book的逻辑代码执行")
    }
    var book = null
    if (book) {
      console.log("分支语句不会执行")
    }


  </script>
</body>

</html>